<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <form id="my-form" class="am-form tpl-form-line-form" method="post">
                    <div class="widget-body">
                        <fieldset>
                            <div class="widget-head am-cf">
                                <div class="widget-title am-fl"> 编辑服务人员</div>
                            </div>
                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label"> 服务人员ID </label>
                                <div class="am-u-sm-9 am-u-md-6 am-u-lg-5 am-u-end am-form--static">
                                    <span><?= $model['user_id'] ?></span>
                                </div>
                            </div>
                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label"> 微信头像 </label>
                                <div class="am-u-sm-9 am-u-md-6 am-u-lg-5 am-u-end am-form--static">
                                    <img width="60" height="60" src="<?= $model['user']['avatarUrl'] ?>" alt="">
                                </div>
                            </div>
                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require"> 姓名 </label>
                                <div class="am-u-sm-9 am-u-md-6 am-u-lg-5 am-u-end">
                                    <input type="text" class="tpl-form-input" name="model[real_name]"
                                           value="<?= $model['real_name'] ?>" placeholder="请输入分销商姓名" required>
                                </div>
                            </div>
                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require"> 手机号 </label>
                                <div class="am-u-sm-9 am-u-md-6 am-u-lg-5 am-u-end">
                                    <input type="text" class="tpl-form-input" name="model[mobile]"
                                           value="<?= $model['mobile'] ?>" placeholder="请输入分销商手机号" required>
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require" for="doc-select-1">选择服务等级</label>
                                <div class="am-u-sm-9 am-u-md-6 am-u-lg-5 am-u-end">

                                    <select id="doc-select-1" name="model[level]" value="<?= $model['level'] ?>" >
                                        <option class="tpl-form-input"  value="0" >未指定</option>

                                        <?php foreach ($levelList as $key => $item): ?>
                                            <option class="tpl-form-input"  value="<?= $item['id'] ?>"  <?php if($item['id'] == $model['level']) echo 'selected'; ?> ><?= $item['level_name'] ?></option>
                                        <?php endforeach; ?>
                                    </select>
                                    <span class="am-form-caret"></span>
                                </div>

                            </div>

                            <div class="am-form-group">
                              <label class="am-u-sm-3 am-u-lg-2 am-form-label" for="doc-select-1">选择团队</label>
                              <div class="am-u-sm-9 am-u-md-6 am-u-lg-5 am-u-end">

                                <select id="doc-select-1" name="model[pid]" value="<?= $model['pid'] ?>" >
                                    <option class="tpl-form-input"  value="">选择团队...</option>

                                    <?php foreach ($parentList as $key => $item): ?>
                                        <option class="tpl-form-input"  value="<?= $item['user_id'] ?>"  <?php if($item['user_id'] == $model['pid']) echo 'selected'; ?> ><?= $item['real_name'] ?></option>
                                    <?php endforeach; ?>
                                </select>
                                <span class="am-form-caret"></span>
                              </div>
                              
                            </div>



                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require"> 成为时间 </label>
                                <div class="am-u-sm-9 am-u-md-6 am-u-lg-5 am-u-end am-form--static">
                                    <span><?= $model['create_time'] ?></span>
                                </div>
                            </div>
                            <div class="am-form-group">
                                <div class="am-u-sm-9">
                                    <?php foreach ($typeList as $key => $item): ?>
                                        <label class="am-checkbox-inline">
                                            <input type="checkbox" name="model[type_ids][]" value="<?= $item['type_id'] ?>"
                                                   data-am-ucheck
                                                <?php if(in_array($item['type_id'],$type_ids)) echo 'checked'; ?>
                                                   required>
                                            <?= $item['name'] ?>
                                        </label>
                                    <?php endforeach; ?>
                                </div>
                            </div>
                            <div class="am-form-group">
                                <div class="am-u-sm-9 am-u-sm-push-3 am-margin-top-lg">
                                    <button type="submit" class="j-submit am-btn am-btn-sm am-btn-secondary">提交
                                    </button>
                                </div>
                            </div>
                        </fieldset>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<script>
    $(function () {

        /**
         * 表单验证提交
         * @type {*}
         */
        $('#my-form').superForm();

    });
</script>
